package com.du.web.sample.util.state.contract;

import com.du.web.sample.util.state.AbstractFlow;
import com.du.web.sample.util.state.FlowVO;
import com.du.web.sample.util.state.leave.EndHandler;
import com.du.web.sample.util.state.leave.StartHandler;

import java.util.ArrayList;
import java.util.List;

/**
 * @desc:
 * @author: shuangdu
 * @date: 2022/11/30
 * @since: 1.8
 */
public class ContractFlow extends AbstractFlow {
    private static List<FlowVO> flowList;
    static {
        flowList = new ArrayList<>();
        FlowVO start = new FlowVO();
        start.setFrom(ContractState.BEGIN)
                .setTo(ContractState.END)
                .setHandler(new StartHandler());

        flowList.add(start);

        FlowVO end = new FlowVO<>();
        end.setFrom(ContractState.END)
                .setTo(ContractState.END)
                .setHandler(new EndHandler());

        flowList.add(end);
    }

    public ContractFlow() {
        pushMap(flowList);
    }
}
